package cn.saltybe.analysis.util;

public enum ApiResponseCode {
    NORMAL(0, "OK"),
    INVALID_PARAM(-10, "Invalid parameters"),
    RUNTIME_EXCEPTION(-11, "Runtime exception"),
    NULL_POINTER_EXCEPTION(-12, "Null pointer exception"),
    CLASS_CAST_EXCEPTION(-13, "Class cast exception"),
    IO_EXCEPTION(-14, "IO exception"),
    NO_SUCH_METHOD_EXCEPTION(-15, "No such method"),
    INDEX_OUT_OF_BOUNDS_EXCEPTION(-16, "Index out of bound"),
    REQUEST_NOT_READABLE(-17, "Request not readable"),
    TYPE_MISMATCH(-18, "Type mismatch"),
    MISSING_SERVLET_REQUEST(-19, "Missing servlet request"),
    HTTP_REQUEST_METHOD_NOT_SUPPORTED(-20, "Http request method not supported"),
    HTTP_MEDIA_TYPE_NOT_ACCEPTABLE(-21, "Http media type not acceptable"),
    STACK_OVERFLOW(-22, "Stack overflow"),
    UNKNOWN_EXCEPTION(-1, "Unknown exception");

    private int code;
    private String message;

    ApiResponseCode(int code, String message){
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
